#!/bin/bash 
ZOOKEEPER=/usr/local/hbaseinstall/zookeeper/bin/zkServer.sh
HADOOP=/usr/local/hbaseinstall/hadoop/hadoop-2.6.0-cdh5.7.0/sbin/hadoop-daemon.sh
KAFKA_BIN=/usr/local/hbaseinstall/kafka/kafka_2.12-2.2.0/bin
KAFKA_CONFIG=/usr/local/hbaseinstall/kafka/kafka_2.12-2.2.0/config/server.properties
HBASE_BIN=/usr/local/hbaseinstall/hbase/hbase-1.2.0-cdh5.7.0/bin

case $1 in
start) 
echo "start......"
$ZOOKEEPER start
$HADOOP start namenode
$HADOOP start datanode
$HBASE_BIN/start-hbase.sh
$KAFKA_BIN/kafka-server-start.sh -daemon $KAFKA_CONFIG
;; 
stop) 
echo "stop......"
$ZOOKEEPER stop
$HADOOP stop namenode
$HADOOP stop datanode
$HBASE_BIN/stop-hbase.sh
$KAFKA_BIN/kafka-server-stop.sh
;; 
esac
